package homework.day01;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class HomeWork0314 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("./note.txt");
        System.out.println("请输入内容:");
        Scanner scan=new Scanner(System .in);
        while( true) {
            String str= scan.nextLine();
            if("exit".equalsIgnoreCase(str.trim())){//忽略大小写  去掉两端 空格
                break;
            }
            byte[] data = str.getBytes(StandardCharsets.UTF_8);
            fos.write(data);
        }
        fos.close();
        System.out.println("写出完毕！");
    }
}
